package com.csc.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.csc.dao.Counter;
import com.csc.dao.LoginDAO;
import com.csc.domain.SystemAccount;

@Service
public class LoginServiceImpl implements LoginService {
	@Autowired
	LoginDAO loginDao;

	public SystemAccount checkLogin(String userName, String password) {
		return loginDao.checkLogin(userName, password);
	}

	public void addOnline(String loginId) {
		Counter.add(loginId);
	}

	public void removeOnline(String loginId) {
		Counter.remove(loginId);
	}

	public int getCurrentOnline() {
		return Counter.size();
	}

	// Nguyen Vu Hung
	@Override
	public List<SystemAccount> getListAccountNew() {
		// TODO Auto-generated method stub
		return loginDao.getListAccountNew();
	}
}
